package org.idea.spring.bean.beandefinitionbuilder;

import org.springframework.beans.factory.InitializingBean;

/**
 * @Author idea
 * @Date created in 7:53 上午 2020/6/2
 */
public class User implements InitializingBean {

    private int id;

    private String name;

    public User(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public User() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    public static User createUser(){
        User user = new User();
        user.setId(1);
        user.setName("idea");
        return user;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("[user] after");
    }
}
